<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>后台登录-X-admin1.1</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="shortcut icon" th:href="@{/favicon.ico}" type="image/x-icon" />
    <link rel="stylesheet" th:href="@{/X-Admin/css/font.css}">
    <link rel="stylesheet" th:href="@{/X-Admin/css/xadmin.css}">
    <link rel="stylesheet" th:href="@{https://cdn.bootcss.com/Swiper/3.4.2/css/swiper.min.css}">
    <script type="text/javascript" th:src="@{https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js}"></script>
    <script type="text/javascript" th:src="@{https://cdn.bootcss.com/Swiper/3.4.2/js/swiper.jquery.min.js}"></script>
    <script th:src="@{/X-Admin/lib/layui/layui.js}" charset="utf-8"></script>
    <script type="text/javascript" th:src="@{/X-Admin/js/xadmin.js}"></script>

</head>
<body>
<!-- 中部开始 -->
<!--<div class="wrapper">-->
<!--    &lt;!&ndash; 右侧主体开始 &ndash;&gt;-->
<!--    <div class="page-content">-->
<!--      <div class="content">-->
<!--        &lt;!&ndash; 右侧内容框架，更改从这里开始 &ndash;&gt;-->
<!--        <form class="layui-form">-->
<!--            <div class="layui-form-item">-->
<!--                <label for="L_email" class="layui-form-label">-->
<!--                    邮箱-->
<!--                </label>-->
<!--                <div class="layui-input-inline">-->
<!--                    <input type="text" id="L_email" name="email" required lay-verify="email"-->
<!--                    autocomplete="off" value="113664000@qq.com" class="layui-input">-->
<!--                </div>-->
<!--                <div class="layui-form-mid layui-word-aux">-->
<!--                    如果您在邮箱已激活的情况下，变更了邮箱，需-->
<!--                    <a href="/user/activate/" style="font-size: 12px; color: #4f99cf;">-->
<!--                        重新验证邮箱-->
<!--                    </a>-->
<!--                    。-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="layui-form-item">-->
<!--                <label for="L_username" class="layui-form-label">-->
<!--                    昵称-->
<!--                </label>-->
<!--                <div class="layui-input-inline">-->
<!--                    <input type="text" id="L_username" name="username" required lay-verify="required"-->
<!--                    autocomplete="off" value="zhibinm" class="layui-input">-->
<!--                </div>-->
<!--                <div class="layui-inline">-->
<!--                    <div class="layui-input-inline">-->
<!--                        <input type="radio" name="sex" value="0" checked title="男">-->
<!--                        <input type="radio" name="sex" value="1" title="女">-->
<!--                    </div>-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="layui-form-item">-->
<!--                <label for="L_city" class="layui-form-label">-->
<!--                    城市-->
<!--                </label>-->
<!--                <div class="layui-input-inline">-->
<!--                    <input type="text" id="L_city" name="city" autocomplete="off" value="广州"-->
<!--                    class="layui-input">-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="layui-form-item layui-form-text">-->
<!--                <label for="L_sign" class="layui-form-label">-->
<!--                    签名-->
<!--                </label>-->
<!--                <div class="layui-input-block">-->
<!--                    <textarea placeholder="随便写些什么刷下存在感" id="L_sign" name="sign" autocomplete="off"-->
<!--                    class="layui-textarea" style="height: 80px;"></textarea>-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="layui-form-item">-->
<!--                <label for="L_sign" class="layui-form-label">-->
<!--                </label>-->
<!--                <button class="layui-btn" key="set-mine" lay-filter="save" lay-submit>-->
<!--                    保存-->
<!--                </button>-->
<!--            </div>-->
<!--        </form>-->
<!--        &lt;!&ndash; 右侧内容框架，更改从这里结束 &ndash;&gt;-->
<!--      </div>-->
<!--    </div>-->
<!--    &lt;!&ndash; 右侧主体结束 &ndash;&gt;-->
<!--</div>-->
<!-- 中部结束 -->
<div class="wrapper">
    <!-- 右侧主体开始 -->
    <div class="page-content">
        <div class="content">
            <!-- 右侧内容框架，更改从这里开始 -->
            <!--<iframe style="display: none" id="myIframe" name="myIframe"></iframe>-->
            <form  method="post" th:action="@{/user/edit}" target="_self">

                <input type="hidden" name="id" id="L_id"/>

                <div class="layui-form-item">
                    <label for="L_username" class="layui-form-label">
                        <span class="x-red">*</span>用户名
                    </label>
                    <div class="layui-input-inline">
                        <input readonly type="text" id="L_username" name="userName" required="" lay-verify="userName"
                               autocomplete="off" class="layui-input">
                    </div>
                    <div class="layui-form-mid layui-word-aux">
                        <span class="x-red">*</span>不可更改
                    </div>
                </div>

                <div class="layui-form-item">
                    <label for="L_pass" class="layui-form-label">
                        <span class="x-red">*</span>密码
                    </label>
                    <div class="layui-input-inline">
                        <input type="text" id="L_pass" name="password" required=""
                               autocomplete="off" class="layui-input">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label for="L_gender" class="layui-form-label">
                        <span class="x-red">*</span>性别
                    </label>
                    <div class="layui-input-inline">
                        <select readonly id="L_gender" name="gender" required="" lay-verify="gender"
                                autocomplete="off" class="layui-input">
                            <option></option>
                        </select>
                    </div>
                    <div class="layui-form-mid layui-word-aux">
                        <span class="x-red">*</span>不可更改
                    </div>
                </div>

                <div class="layui-form-item">
                    <label for="L_email" class="layui-form-label">
                        <span class="x-red">*</span>邮箱
                    </label>
                    <div class="layui-input-inline">
                        <input type="text" id="L_email" name="email" required="" lay-verify="email"
                               autocomplete="off" class="layui-input">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label for="L_birth" class="layui-form-label">
                        <span class="x-red">*</span>生日
                    </label>
                    <div class="layui-input-inline">
                        <input type="datetime-local" id="L_birth" name="birth" required="" lay-verify="birth"
                               autocomplete="off" class="layui-input">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label for="L_identity" class="layui-form-label">
                        <span class="x-red">*</span>身份
                    </label>
                    <div class="layui-input-inline">
                        <select readonly id="L_identity" name="identity" required="" lay-verify="identityT"
                                autocomplete="off" class="layui-input">
                            <option></option>
                        </select>
                    </div>
                    <div class="layui-form-mid layui-word-aux">
                        <span class="x-red">*</span>不可更改
                    </div>
                </div>

                <div class="layui-form-item">
                    <label for="L_status" class="layui-form-label">
                        <span class="x-red">*</span>状态
                    </label>
                    <div class="layui-input-inline">
                        <select readonly id="L_status" name="status" required="" lay-verify="status"
                                autocomplete="off" class="layui-input">
                            <option></option>
                        </select>
                    </div>
                    <div class="layui-form-mid layui-word-aux">
                        <span class="x-red">*</span>不可更改
                    </div>
                </div>

                <div class="layui-form-item">
                    <label for="L_status" class="layui-form-label">
                    </label>
                    <button type="submit" onclick="MyClose()"  class="layui-btn" lay-filter="add" lay-submit="">
                        提交
                    </button>
                </div>

            </form>
            <!-- 右侧内容框架，更改从这里结束 -->
        </div>
    </div>
    <!-- 右侧主体结束 -->
</div>
<!-- 中部结束 -->

<script>
    function child(obj){

        /**
         * 0:id
         * 1:userName
         * 2:password
         * 3:gender
         * 4:email
         * 5:birth
         * 6:identity
         * 7:status
         */

        let id=document.getElementById("L_id");
        let userName=document.getElementById("L_username");
        let password=document.getElementById("L_pass");
        let gender=document.getElementById("L_gender");
        let email=document.getElementById("L_email");
        let birth=document.getElementById("L_birth");
        let identity=document.getElementById("L_identity");
        let status=document.getElementById("L_status");

        id.value=obj[0];
        userName.value=obj[1].replace("\"","").replace("\"","");
        password.value=obj[2].replace("\"","").replace("\"","");
        email.value=obj[4].replace("\"","").replace("\"","");
        birth.value=obj[5].replace("\"","").replace("\"","");

        console.log(obj[0]);

        if (obj[3]=="0"){
            let g="女";
            gender.children[0].value=obj[3];
            gender.children[0].innerText=g;
            console.log(g);
        }else {
            let g="男";
            gender.children[0].value=obj[3];
            gender.children[0].innerText=g;
            console.log(g);
        }

        if (obj[6]=="1"){
            let i="超级管理员";
            identity.children[0].value=obj[6];
            identity.children[0].innerText=i;
        }else {
            let i="普通用户";
            identity.children[0].value=obj[6];
            identity.children[0].innerText=i;
        }

        if (obj[7]=="1"){
            let s="已启用";
            status.children[0].value=obj[7];
            status.children[0].innerText=s;
        }else {
            let s="已停用";
            status.children[0].value=obj[7];
            status.children[0].innerText=s;
        }
        // x_admin_close();
    }
    function MyClose(){
        x_admin_close();
    }
</script>
</body>
</html>